__kernel void calculate(
	__global const double* A,
	__global double* B) {
	size_t gid = get_global_id(0);
	const double ddx = 1.0 / 137438953472.0; // 1e-11
	double st = A[gid];
	double ed = A[gid + 1];
	double x = 0.0, sum = 0.0;
	for (x = st; x < ed; x += ddx) {
		sum += sqrt(1 - x * x);
	}
	sum *= ddx;
	B[gid] = sum;
}
